package com.benbi.shequapi.utils;

public class Result {
    public static int SUCCESS_CODE = 0;
    public static String SUCCESS_MSG = "成功";

    protected int error_code;
    protected String msg;

    public Result(int errorCode, String msg){
        this.error_code = errorCode;
        this.msg = msg;
    }

    public Result(String msg){
        this.error_code = SUCCESS_CODE;
        this.msg = msg;
    }

    public Result(){
        this.error_code = SUCCESS_CODE;
        this.msg = SUCCESS_MSG;
    }

    public Result(ResultData resultData){
        this.error_code = resultData.error_code;
        this.msg = resultData.msg;
    }

    public int getError_code() {
        return error_code;
    }

    public void setError_code(int error_code) {
        this.error_code = error_code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public boolean isSuccess(){
        return this.error_code == SUCCESS_CODE;
    }
}
